/**
 * @author hewei
 * @version 1.0
 * @description: 1015. 可被 K 整除的最小整数
 * @date 2022/10/18 19:27
 */

public class SmallestRepunitDivByK {

    public int smallestRepunitDivByK(int k) {
        if (k % 5 == 0 || k % 2 == 0) return -1;
        int temp = 1;
        int res = 1;
        while (temp % k != 0) {
            temp %= k;
            temp = temp * 10 + 1;
            ++res;
        }
        return res;
    }
}
